#ifndef USER_H
#define USER_H

#include <iostream>
#include <string>
#include <time.h>
#include "Account.h"

using namespace std;
//@author U095387X
class User{
	
//Attributes
private:
	string _name;
	double _budget;	//amount of cash want to save
	double _cashOnHand;	//amount of cash can be used
	double _totalExpense;
	Account _userAccount;
	time_t  _lastUsed;

//Methods
public:

	//Constuctor
	User();
	User( string name, double budget, double cashOnHand);

	//Getter
	void loadUser();
	string getName();
	double getBudget();
	double getCashOnHand();
	double getTotalExpense();
	Account *getUserAccount();
	time_t getLastUsed();

	//Updater
	void updateName( string newName );
	void updateBudget( double newBudget );
	void updateCashOnHand( double newCashOnHand );
	void updateTotalExpense (double newTotalExpense);

	void addExpense(Expense newExpense);
	void addIncome(Income newIncome);
	void addWish(Wish newWish);
	void addLoan(Loan newLoan);

	void deleteExpense(Expense expenseToDelete);
	void deleteIncome(Income incomeToDelete);
	void deleteWish(Wish wishToDelete);
	void deleteLoan(Loan loanToDelete);

	void updateExpense(Expense expenseToDelete, Expense newExpense);
	void updateIncome(Income incomeToDelete, Income newIncome);
	void updateWish(Wish wishToDelete, Wish newWish);
	void updateLoan(Loan loanToDelete, Loan newLoan);

	bool existUser();
	void saveUser();

};

#endif